<div id="nonjob-line1" style="height: 100%">

</div>
<script type="text/javascript">
    $(function () {
        $.ajax({
            url: "#springUrl('/view/nonjob/line1')",
            data: {"batchId": "$!{batchId}"},
            type: "POST",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    var myChart = echarts.init(document.getElementById('nonjob-line1'), 'macarons');
                    var option = {
                        title: {
                            text: '固定资产周转率'
                            , show: false
                        },
                        tooltip: {
                            trigger: 'axis',
                            formatter: function (params) {
                                return params[0].name + "<br/>" + params[0].value + "%";
                            },
                            axisPointer: {
                                animation: false
                            }
                        }, grid: {
                            top: 20,
                            left: 5,
                            right: 5,
                            bottom: 5,
                            containLabel: true
                        },
                        xAxis: {
                            type: 'category',
                            boundaryGap: false,
                            data: d.data.name,
                            axisLabel: {
                                textStyle:{
                                    color:"#595959"
                                }
                            },
                            axisLine: {
                                show: false
                            },
                            axisTick: {
                                show: false
                            },
                        },
                        yAxis: {
                            type: 'value',
                            axisLine: {
                                show: false
                            },
                            axisTick: {
                                show: false
                            },
                            axisLabel: {
                                formatter: function(value){
                                    var var1=value*1;
                                    return var1;
                                },
                                textStyle:{
                                    color:"#595959"
                                }
                            },
                            splitLine:{
                                show:true
                            },
                            splitArea: {
                                show:true,
                                areaStyle: {
                                    color: ['rgba(0,0,0,0)', 'rgba(0,0,0,0)']
                                }
                            },
                        },
                        series: [{
                            name: '固定资产周转率',
                            type: 'line',
                            showSymbol: false,
                            hoverAnimation: false,
                            data: d.data.value,
                            barWidth:30,
                            itemStyle: {
                                normal: {
                                    //好，这里就是重头戏了，定义一个list，然后根据所以取得不同的值，这样就实现了，
                                    color: function(params) {
                                        // build a color map as your need.
                                        var colorList = [
                                            '#0fa99d','#d9d9d9','#4472c4','#c9eee7','#e7a14c',
                                            '#787473','#9BCA63','#FAD860','#F3A43B','#60C0DD',
                                            '#D7504B','#C6E579','#F4E001','#F0805A','#26C0C0'
                                        ];
                                        return colorList[params.dataIndex]
                                    },
                                    //以下为是否显示，显示位置和显示格式的设置了
                                }}
                        }]
                    };
                    myChart.setOption(option);
                }
            }
        });
    });
</script>


